package cn.bdqn.controller;

import cn.bdqn.entity.SysMenu;
import cn.bdqn.service.SysMenuService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.*;

/**
 * 菜单管理(SysMenu)表控制层
 *
 * @author makejava
 * @since 2020-12-01 10:40:20
 */
@RestController
@RequestMapping("/sysMenu")
public class SysMenuController {
    /**
     * 服务对象
     */
    @Resource
    private SysMenuService sysMenuService;

    @RequestMapping("/delete")
    public Object delete(@RequestBody String menuId){
        return true;
    }

    @RequestMapping("/findByParentId")
    public Object findByParentId(){
        List<SysMenu> list=sysMenuService.findByParentId();
        for (SysMenu sysMenu : list) {
            System.out.println(sysMenu);
        }
        return list;
    }

}
